Hello, |
Re: Apply Button - GUI interface Help needed Thank you! the basic idea of remote control is to replace block and show by a call to 'realize' by overwriting the functions. Afterwards you include the GUI script (enhanced Excel Export) in your case. Executing this script will make the dialog box appear, but not stop the script afterwards. Then after the include statement, you fill in the values of all dialog box elements using set(...) functions. For this you need to find out the variable names of the GUI elements from the source code of the script, but you do not need to change anything. Then you 'press' the apply button, by just calling the callback function of the apply button manually. Then you destroy the dialog. It is pretty straight forward. You can find examples for this technique here: https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14495781� https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14602630� https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14585984� This should give you a quick start on the issue. Hope that helps, regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Apply Button - GUI interface Help needed Thank you! Mathias Mamsch - Fri Feb 10 05:43:19 EST 2012 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Below is what I have so far. When I run this it doesn't execute the apply button but when I hit close it executes, what am I doing wrong? I have done little to none coding using the dialog functionality. and the reference guide is not really helpfull. #include <C:/Enhanced Export to Excel.dxl> realize excelExportDB exportModuleToExcel excelExportDB Thank you, Jim |
Re: Apply Button - GUI interface Help needed Thank you! SystemAdmin - Fri Feb 10 11:11:57 EST 2012
No, the trick is to redefine block and show. You do not call realize, by defining the functions before the include, instead of the includes calling the original show or block it will call your functions, actually just doing realize. Then after your include the code will continue. It might be too complicated at the moment - you might want to read the posts I referenced whenever you feel like it. The below works for me. If you want specific settings, just place the set calls before the exportModuleToExcel call. Hope that helps, regards, Mathias
// override some default message box functions, so they will only print the data but
// not pause execution. Write to a log file here!
bool confirm (string s) { print "Confirmed: " s "\n"; return true }
void ack (string s) {print "Acknowledge: " s "\n" }
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infobox (string s) {print "Info: " s "\n" }
void info (string s) {print "Info: " s "\n" }
DB tmpDB = null
// Now override block and show, to only do realize
void show (DB x) { realize x; tmpDB = x }
void block (DB x) { realize x; tmpDB = x }
{
#include <c:/temp/EnhancedExport.dxl>
exportModuleToExcel excelExportDB
}
destroy tmpDB
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Apply Button - GUI interface Help needed Thank you! Mathias Mamsch - Fri Feb 10 12:27:07 EST 2012
No, the trick is to redefine block and show. You do not call realize, by defining the functions before the include, instead of the includes calling the original show or block it will call your functions, actually just doing realize. Then after your include the code will continue. It might be too complicated at the moment - you might want to read the posts I referenced whenever you feel like it. The below works for me. If you want specific settings, just place the set calls before the exportModuleToExcel call. Hope that helps, regards, Mathias
// override some default message box functions, so they will only print the data but
// not pause execution. Write to a log file here!
bool confirm (string s) { print "Confirmed: " s "\n"; return true }
void ack (string s) {print "Acknowledge: " s "\n" }
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infobox (string s) {print "Info: " s "\n" }
void info (string s) {print "Info: " s "\n" }
DB tmpDB = null
// Now override block and show, to only do realize
void show (DB x) { realize x; tmpDB = x }
void block (DB x) { realize x; tmpDB = x }
{
#include <c:/temp/EnhancedExport.dxl>
exportModuleToExcel excelExportDB
}
destroy tmpDB
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Once again thank for your reply.
// override some default message box functions, so they will only print the data but
// not pause execution. Write to a log file here!
bool confirm (string s) { print "Confirmed: " s "\n"; return true }
void ack (string s) {print "Acknowledge: " s "\n" }
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infobox (string s) {print "Info: " s "\n" }
void info (string s) {print "Info: " s "\n" }
DB tmpDB = null
// Now override block and show, to only do realize
void show (DB x) { realize x; tmpDB = x }
void block (DB x) { realize x; tmpDB = x }
{
#include <c:/temp/EnhancedExport.dxl>
exportModuleToExcel excelExportDB
Button A
Button B
}
destroy tmpDB
|
Re: Apply Button - GUI interface Help needed Thank you! SystemAdmin - Fri Feb 10 13:57:13 EST 2012
Once again thank for your reply.
// override some default message box functions, so they will only print the data but
// not pause execution. Write to a log file here!
bool confirm (string s) { print "Confirmed: " s "\n"; return true }
void ack (string s) {print "Acknowledge: " s "\n" }
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infobox (string s) {print "Info: " s "\n" }
void info (string s) {print "Info: " s "\n" }
DB tmpDB = null
// Now override block and show, to only do realize
void show (DB x) { realize x; tmpDB = x }
void block (DB x) { realize x; tmpDB = x }
{
#include <c:/temp/EnhancedExport.dxl>
exportModuleToExcel excelExportDB
Button A
Button B
}
destroy tmpDB
Sorry for the last reply I hit the enter key by mistake. I have another question please see below. Thank you once again.
// override some default message box functions, so they will only print the data but
// not pause execution. Write to a log file here!
bool confirm (string s) { print "Confirmed: " s "\n"; return true }
void ack (string s) {print "Acknowledge: " s "\n" }
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infobox (string s) {print "Info: " s "\n" }
void info (string s) {print "Info: " s "\n" }
DB tmpDB = null
// Now override block and show, to only do realize
void show (DB x) { realize x; tmpDB = x }
void block (DB x) { realize x; tmpDB = x }
{
#include <c:/temp/EnhancedExport.dxl>
exportModuleToExcel excelExportDB
Button B -- How would you implement additional buttons. After a the printing GUI presents another Button I would like to execute it.
from reading the posting I don't see how to implememt this... inless I am over looking something.
}
destroy tmpDB
|
Re: Apply Button - GUI interface Help needed Thank you! SystemAdmin - Fri Feb 10 21:33:53 EST 2012
Sorry for the last reply I hit the enter key by mistake. I have another question please see below. Thank you once again.
// override some default message box functions, so they will only print the data but
// not pause execution. Write to a log file here!
bool confirm (string s) { print "Confirmed: " s "\n"; return true }
void ack (string s) {print "Acknowledge: " s "\n" }
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infobox (string s) {print "Info: " s "\n" }
void info (string s) {print "Info: " s "\n" }
DB tmpDB = null
// Now override block and show, to only do realize
void show (DB x) { realize x; tmpDB = x }
void block (DB x) { realize x; tmpDB = x }
{
#include <c:/temp/EnhancedExport.dxl>
exportModuleToExcel excelExportDB
Button B -- How would you implement additional buttons. After a the printing GUI presents another Button I would like to execute it.
from reading the posting I don't see how to implememt this... inless I am over looking something.
}
destroy tmpDB
Actually there was a typo in the code. The function 'infoBox' is actually written with an uppercase 'B'. The message box should have been overridden by the infobox function at the start, but since we misspelled it, the information box was not replaced. Find the correct code below:
...
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infoBox (string s) {print "Info: " s "\n" } // use uppercase B in function name
... rest of the code ...
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Apply Button - GUI interface Help needed Thank you! Mathias Mamsch - Sat Feb 11 05:07:04 EST 2012
Actually there was a typo in the code. The function 'infoBox' is actually written with an uppercase 'B'. The message box should have been overridden by the infobox function at the start, but since we misspelled it, the information box was not replaced. Find the correct code below:
...
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infoBox (string s) {print "Info: " s "\n" } // use uppercase B in function name
... rest of the code ...
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Once again thank you for your help. I there a way on modifying the script so that it would allows me to append to a file rather than over write each time. I am trying to see where the code keeps trace of the current row; so far I cannot find - inless I overlooking something?. Attach is the my script, I am current writting to a csv file but I would like to print the ole object and using the cvs method I cannot. And depending on how the object was written it breaks the cvs file. I am putting a text object in "" but that doesn't always fix the issue am I over looking somthing? I would prefer to have the ole object printed. Any help would be appreciated. Thank you, Jim Attachments attachment_14789260_Metrics.dxl |
Re: Apply Button - GUI interface Help needed Thank you! SystemAdmin - Mon Feb 13 13:51:31 EST 2012
|